package com.ws.entity;

/**
 * @author 王硕
 * @version jdk21
 * @className Test01
 * @description
 * @date 2024/10/28 20:17
 */
public class Test01 {
    public static void main(String args[]){
        //1.求一光年是多少千米 , 光在真空中传播速度299792458 m/s
        Test01();
        int num = 657;
        int sum = (num / 100) + (num % 100 / 10) + (num % 10);
        System.out.println("各个位数的和是：" + sum);

    }

    private static void Test01() {
        int SpeedPerSecond = 299792458;
        int SecondsInADay = 86400;
        int SecondsInAYear = SecondsInADay*30*12;
        int HowKilometer = SpeedPerSecond * SecondsInAYear/1000;
        System.out.println("一光年是"+HowKilometer+"千米");
    }
}
